Skip to content

docs(simulators): mirror autogalaxy_workspace simulators + retarget tutorial subprocess paths#11

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/tutorial-simulator-paths
May 28, 2026
Merged

docs(simulators): mirror autogalaxy_workspace simulators + retarget tutorial subprocess paths#11
Jammy2211 merged 1 commit into
mainfrom
feature/tutorial-simulator-paths

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Eleven HowToGalaxy tutorials subprocess to autogalaxy_workspace-style paths that don't exist in this repo:

  • 10 reference scripts/imaging/simulator.py → dataset simple (bulge+disk Sersic+Exponential)
  • 1 references scripts/guides/plot/simulator.py → dataset sersic_x2

All fail with CalledProcessError ... exit 2. NEEDS_FIX-parked 48 days.

Mirror the matching workspace simulators into HowToGalaxy as local files and update the 11 tutorial subprocess paths. Two new files (verbatim copies), 11 one-line tutorial edits.

Why not retarget to existing sersic.py?

scripts/simulators/sersic.py writes a bulge-only galaxy as simple__sersic. Tutorials like tutorial_3_realism_and_complexity.py fit af.Model(Galaxy, bulge=Sersic, disk=Exponential) — retargeting would leave the disk params unconstrained, NaN posteriors, and confuse readers. Mirroring the autogalaxy_workspace simulator preserves model↔data integrity.

Test plan

  • python scripts/simulators/simple.py writes dataset/imaging/simple/{data,noise_map,psf}.fits + galaxies.json.
  • python scripts/simulators/sersic_x2.py writes dataset/imaging/sersic_x2/....
  • PYAUTO_TEST_MODE=2 python scripts/chapter_1_introduction/tutorial_3_fitting.py runs to completion.
  • Next autobuild run_all howtogalaxy --timeout-secs 300 flips the 11 affected tutorials from FAIL to PASS.

Related

  • HowToLens twin (1 mirror + 8 tutorial edits) shipping in parallel.

🤖 Generated with Claude Code

…utorial subprocess paths

11 tutorials across chapters 1-4 subprocess to simulator paths that
don't exist in HowToGalaxy:

- 10 reference `scripts/imaging/simulator.py` (writes dataset `simple`)
- 1 references `scripts/guides/plot/simulator.py` (writes dataset `sersic_x2`)

Both are autogalaxy_workspace-style paths inherited when these
tutorials were originally adapted from that workspace. HowToGalaxy
has no equivalent local simulators, so every affected tutorial
exits 2 (file not found) during the subprocess auto-simulate step.

Retargeting to the existing `scripts/simulators/sersic.py` was
considered and rejected — its `simple__sersic` dataset is bulge-only
while several tutorials (e.g. `tutorial_3_realism_and_complexity.py`)
fit a bulge+disk model. Mirroring the matching workspace simulators
preserves model↔data integrity.

Two new files (verbatim copies):
- `scripts/simulators/simple.py` ← `autogalaxy_workspace/scripts/imaging/simulator.py`
- `scripts/simulators/sersic_x2.py` ← `autogalaxy_workspace/scripts/guides/plot/simulator.py`

11 mechanical one-line subprocess path edits in the affected tutorials.
No tutorial logic changes; the dataset names already used by the
tutorials (`simple`, `sersic_x2`) now match what the new local
simulators write.

Verified locally:
- `python scripts/simulators/simple.py` writes
  `dataset/imaging/simple/{data.fits, noise_map.fits, psf.fits, ...}`.
- `python scripts/simulators/sersic_x2.py` writes
  `dataset/imaging/sersic_x2/...`.
- `python scripts/chapter_1_introduction/tutorial_3_fitting.py` runs
  to completion under `PYAUTO_TEST_MODE=2`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit c0a8ba2 into main May 28, 2026
6 checks passed
@Jammy2211 Jammy2211 deleted the feature/tutorial-simulator-paths branch May 28, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant